Skip to content

Fix empty key exception in raw tag editor and clean up linting spacing#12043

Open
JaiswalShivang wants to merge 3 commits intoopenstreetmap:developfrom
JaiswalShivang:fix/raw-tag-editor-lint-spacing
Open

Fix empty key exception in raw tag editor and clean up linting spacing#12043
JaiswalShivang wants to merge 3 commits intoopenstreetmap:developfrom
JaiswalShivang:fix/raw-tag-editor-lint-spacing

Conversation

@JaiswalShivang
Copy link
Contributor

Fixes: [#11970 ]

Description

This PR addresses a bug in the raw tag editor where completely emptying a tag key could dispatch an unwanted or malformed change event. Additionally, it resolves some lingering ESLint formatting warnings in the file.

Changes made

  • Added empty key guard: Inserted an early if (!kNew) return; return in [raw_tag_editor.js] to prevent the editor from attempting to process and dispatch tag changes when a user clears a key input.
  • Added test coverage: Added an explicit test in [test/spec/ui/sections/raw_tag_editor.js] ensuring that emptying a key input correctly aborts and does not fire a change event.

Testing

  • All local tests pass (npm run test:once).
  • ESLint passes with zero warnings on the modified files.

@tyrasd
Copy link
Member

tyrasd commented Mar 18, 2026

Unfortunately, this does not seem to fix the glitch:

Screencast.From.2026-03-18.17-49-19.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants